# -*- Mode: Python -*-

Import('env')
import subprocess

myenv = env.Clone()
#myenv.Append(CXXFLAGS = ' -finstrument-functions -DPROFILE')

proc = subprocess.Popen(
    ['git', 'describe', '--dirty', '--always'],
    stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
(resout, reserr) = proc.communicate()
if reserr != "":
    revision = "-unknown-"
else:
    revision = resout.rstrip()
myenv['CXXFLAGS'] += ' -DNRE_REV=\'\"' + revision + '\"\''

prog = myenv.NREProgram(myenv, 'root', Glob('*.cc'), fixedaddr = True, ldscript = 'root')
